/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * <p>Project: jse2204 - Reg11
 * <p>Powered by webrx On 2022-09-15 14:02:30
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Reg11 {
    public static void main(String[] args) {
        String a = "java8php123javascript6mysql88888html5";
        System.out.println(a);
        System.out.println(a.replaceAll("\\d+?", "-"));//?禁用贪婪

        String str = """
				<div>hello</div><div>java 15</div><div><p>java 15</p><span>java 8</p><div>java 15</div></div>
				""";

        Pattern p = Pattern.compile("<div>[a-z0-9\s]*?java[a-z0-9\s]*?</div>");
        Matcher m = p.matcher(str);
        while(m.find()) {
            System.out.println(m.group());
        }
    }
}
